<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
response.setHeader("Cache-Control","no-cache"); 
response.setHeader("Pragma","no-cache"); 
response.setDateHeader ("Expires", -1); 
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Doctors List</title>
</head>
<body>

	<%@page import="com.cm309.hospital.model.Subject"%>
	<%@page import="com.cm309.hospital.model.Doctor"%>
	<%@page import="com.cm309.hospital.model.DoctorSchedule"%>
	<%@page import="com.cm309.hospital.model.Patient"%>
	<jsp:useBean id="subject" scope="request" type="com.cm309.hospital.model.Subject"></jsp:useBean>
	<jsp:useBean id="subjects" scope="request" type="java.util.List"></jsp:useBean>
	<jsp:useBean id="doctors" scope="request" type="java.util.List"></jsp:useBean>
	<jsp:useBean id="doctor" scope="request" type="com.cm309.hospital.model.Doctor"></jsp:useBean>
	
	<jsp:useBean id="doctorSchedules" scope="request" type="java.util.List"></jsp:useBean>
	<jsp:useBean id="patient" scope="request" type="com.cm309.hospital.model.Patient"></jsp:useBean>

	<form action="patientBook.do" method="post">
	<TABLE border="1">
		<tr>
			<td>病歷號</td>
			<td><%=patient.getPatient_id() %>
				<input type="hidden" name="patient_id" value="<%=patient.getPatient_id()%>">
			</td>
		</tr>
		<tr>
			<td>姓名	</td>
			<td><%=patient.getPatient_name() %></td>
		</tr>
		<tr>
			<td>出生日期</td>
			<td><%=patient.getDate_of_birth() %></td>
		</tr>
		<tr>
			<td>性別	</td>
			<td><%=patient.getSex() %></td>
		</tr>
		<tr>
			<td>科別</td>
			<td><%= subject.getSubject_name() %>
			<input type="hidden" name="subject_id" value="<%=subject.getSubject_id()%>">			
			</td>
		</tr>
 		
		<tr>
			<td>醫生</td>

			<td><%= doctor.getName() %>
				<input type="hidden" name="doctor_id" value="<%=doctor.getDoctor_id()%>">			
			</td>
		</tr>
		<tr>
			<td>預約日期  (YYYY/MM/DD)</td>
			<td><select name="doctor_schedule_id">
			<%
				for (int i=0; i < doctorSchedules.size();i++)
				{
					DoctorSchedule s = (DoctorSchedule) doctorSchedules.get(i);
			%>
					<option value=<%=s.getDoctor_schedule_id()%> ><%=s.getAm_pm_label() %></option>			
			<% 
				}
			%>
			</select>
			
			</td>
		</tr>
	</TABLE>
	
	<br>
	<input type="submit" value="掛號">
	</form>

	<br>
	<a href="mainPage.do">返回主目錄</a>

</body>

<script type="text/javascript">



</script>



</html>